using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OracleClient;

using FoxConn.Lib.Dbo;

namespace OracleToInformix.Source
{
    class OracleUtil
    {
        public OracleUtil()
        { }

        public static DataSet GetHrmEmployees()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("SELECT '2' CARDTYPEID,WORKNO CPF01,LOCALNAME CPF02,he.LEVELCODE CPF10,decode(PERSONTYPECODE,'15','I','D') CPF14,");
            sb.Append("'' CPF15,'' CPF16,decode(ed.corporationid,'60','30',ed.CORPORATIONID) CPF29,he.LEAVEDATE CPF35,decode(ed.corporationid,'60',");
            sb.Append(" 'NL6007',ed.costcode) CPF37,'' CPF44,JOINDATE CPF69,decode(he.status,'2','N','Y') CPFACTI,'' CPFDATE,'2' CPFTYPE ");
            sb.Append(" FROM HRM_EMPLOYEES he,BFW_DEPARTMENT ed WHERE he.DEPCODE = ed.DEPCODE AND  deleted = 'N'");


            DBOperation dbo = new DBOperation(0);
            return dbo.GetResult(sb.ToString());
        }

        public static DataSet GetOldHrData()
        {
            string strSql = "select WORKNO from HRM_EMPLOYEES";

            DBOperation dbo = new DBOperation(0);
            return dbo.GetResult(strSql);
        }
    }
}
